package response

type ResponseCode int

const (
	SUCCESS ResponseCode = iota
	UN_ERROR
	ILLEGAL_PARAMETER
)

var responseCodes = [...]struct {
	Code string
	Info string
}{
	{"0000", "成功"},
	{"0001", "未知失败"},
	{"0002", "非法参数"},
}

func (rc ResponseCode) GetCode() string {
	return responseCodes[rc].Code
}

func (rc ResponseCode) GetInfo() string {
	return responseCodes[rc].Info
}